Previously, we saw it's possible to
have a remote repository with Git. We can push code to this remote repository
that is hosted somewhere else and get this code again on our local
machines by pulling this information. There are several platforms on which we
can host our remote repository. The most commonly used platforms are GitHub,
GitLab, and Bitbucket, but
there are also many more out there. Once we've successfully initialized
a repository on one of those platforms, we get access to something
called a connection string. A connection string is a URL that
we can use in order to let Git know where the remote repository is located. We can add the remote repository
to our local project with the git remote add command. We want to add a remote repository and give it the alias origin to make sure that
we always know which remote repository we're pushing to without having to
memorize the entire connection string. In order to do so, we can type git remote add origin
followed by the connection string. After initializing the remote repository,
we have access to this remote repository that is hosted at
the location of the connection string. You can list all your remote repositories
with the git remote-v command. In order to work with this remote
repository, we can fetch and push the necessary data from our
local project to the hosted repo. In this case, we're both pushing and fetching data from the same remote
repository, which Git shows us. First, let's see how we can push
data to this remote repository.